package cn.diancan.util.spring;

import java.util.List;

import cn.diancan.model.ScoreRecord;
import cn.diancan.model.types.ScoreRecordStatusType;
import cn.diancan.model.types.ScoreRecordType;
import cn.diancan.service.ScoreRecordService;

public class ScoreRecordTimg {
    
    
    
    public void handleRecord(){
	ScoreRecordService scoreRecordService = ( ScoreRecordService) SpringContextUtil.getBean("scoreRecordService");
	try {
	    List<ScoreRecord> list=   scoreRecordService.findScoreRecordList(ScoreRecordType.ORDER.getType(),
		    ScoreRecordStatusType.NOHANDLE.getType(), 1, 10);
	    if(null==list){
		return ;
	    }
	    for (ScoreRecord scoreRecord : list) {
		try {
		    scoreRecordService.updateHandleScoreRecord(scoreRecord.getPurchaseSaleOutOrderNumber());
		} catch (Exception e) { 
		    e.printStackTrace();
		}
	    }
	}  catch (Exception e) { 
	    e.printStackTrace();
	}
    }

}
